import api from '../api.js'
//获取招工信息列表
// domain = '[]',order = '', search =''
export function setJobList(pageIndex = '', pageSize = '', name = '', date = '', recruitment_type = '',
	settlement_method = '', recruit_type = '', user_id = '') {
	return api.postFunction('jhj.recruitment.release', '_api_jhj_recruitment_release_list', {
		page: pageIndex,
		limit: pageSize,
		name: name,
		date: date,
		recruitment_type: recruitment_type,
		settlement_method: settlement_method,
		recruit_type: recruit_type,
		user_id
		// domain,
		// order,
		// search
	})
}
// 招工详情
export function setJobDetial(id) {
	console.log(id)
	return api.postPubileApi('jhj.recruitment.release', '_api_public_jhj_recruitment_release_details', {
		rid: id
	})
}
//发布招工信息
export function setJobInformation(recruitment_type, work_type, settlement_method, number, province_id, city_id, area_id,
	contacts, in_person, contacts_method, requirement, label_tag_ids, recruitment_cycle, account_type, location_company_id,userId
) {
	return api.postFunction('jhj.recruitment.release', '_api_jhj_recruitment_release', {
		//招工类型
		recruitment_type: recruitment_type,
		//招工工种
		work_type: work_type,
		//结算方式
		settlement_method: settlement_method,
		//招工人数
		number: number,
		//省
		province_id: province_id,
		//市
		city_id: city_id,
		//区
		area_id: area_id,
		//联系人
		contacts: contacts,
		//是否是本人
		in_person: in_person,
		//联系方式
		contacts_method: contacts_method,
		//招工要求
		requirement: requirement,
		//内容标签
		label_ids: label_tag_ids,
		//发布周期
		recruitment_cycle: recruitment_cycle,
		//角色id
		account_type: account_type,
		//公司id
		location_company_id: location_company_id,
		userId	
	})
}
//发布标签信息
export function setJobLabel() {
	return api.postFunction('jhj.label', '_api_jhj_label', {

	})
}
// 发布工种信息
export function setJobBidding() {
	return api.postFunction('jhj.label', '_api_jhj_bidding_tag', {
		// cms_id: id
	})
}
//省
export function setJobProvince(id = 48) {
	return api.postFunction('jhj.label', '_api_jhj_state', {
		country_id: id
	})
}
//市
export function setJobCity(id) {
	return api.postFunction('jhj.label', '_api_jhj_city', {
		state_id: id
	})
}
//区
export function setJobArea(id) {
	return api.postFunction('jhj.label', '_api_jhj_area', {
		city_id: id,
	})
}
// 找活发布
export function getJobInformation(region, contacts, in_person, recruitment_cycle) {
	return api.postFunction('jhj.work.release', '_api_jhj_work_release', {
		//人员情况
		//工种
		// work_type:work_type,
		// //工种数量
		// number:number, 
		// //参与项目日期
		// project_data:project_data,
		// //参与项目
		// project_name:project_name,
		// //荣誉证书日期
		// certificate_data:certificate_data,
		// //荣誉证书
		// certificate :certificate,
		//承接区域
		region: region,
		//联系人
		contacts: contacts,
		//是否是本人
		in_person: in_person,
		//发布周期
		recruitment_cycle: recruitment_cycle,
	})
}
export function getZzzsList() {
	return api.postFunction('jhj.label', 'jhj_certificate_tag')
}
export function getJobList(pageIndex = '', pageSize = '', name = '', date = '', recruitment_type = '', work_type = '',
	user_id = '') {
	// console.log(pageIndex)
	return api.postFunction('jhj.work.release', '_api_jhj_work_release_list', {
		limit: pageSize,
		page: pageIndex,
		name: name,
		date: date,
		recruitment_type: recruitment_type,
		// work_type : work_type,
		tagname: work_type,
		user_id
	})
}
//找活详情
export function getJobDetail(id) {
	// console.log(id)
	return api.postFunction('jhj.work.release', '_api_public_jhj_work_release_details', {
		wid: id
	})
}
//发布找活
export function releaseGetJob(data) {
	return api.postFunction('jhj.work.release', '_api_jhj_work_release', data)
}

export function writeSetJobState(state,id){
	return api.write('jhj.recruitment.release',{
		['form-field-boolean-in_from_sale']:state
	},id)
}

export function writeGetJobState(state,id){
	return api.write('jhj.work.release',{
		['form-field-boolean-in_from_sale']:state
	},id)
}

//获取招工信息列表
export function mySetJobList(user_id) {
	return api.postFunction('jhj.recruitment.release', '_api_my_jhj_recruitment_release_list', {
		user_id
	})
}

export function myGetJobList(user_id) {
	// console.log(pageIndex)
	return api.postFunction('jhj.work.release', '_api_my_jhj_work_release_list', {
		user_id
	})
}

//招工浏览次数
export function changeSetJobScan(id){
	return api.postFunction('jhj.recruitment.release', '_api_visit_num', {
		work_id:id
	})
}
//找活浏览次数
export function changeGetJobScan(id){
	return api.postFunction('jhj.work.release', '_api_visit_num', {
		work_id:id
	})
}

//招工联系次数
export function changeSetJobContact(id){
	return api.postFunction('jhj.recruitment.release', '_api_contact_num', {
		work_id:id
	})
}
//找活联系次数
export function changeGetJobContact(id){
	return api.postFunction('jhj.work.release', '_api_contact_num', {
		work_id:id
	})
}